package dao

func Offset(page, size int) (offset int, limit int) {
	if page <= 0 {
		page = 0
	}
	if size <= 0 {
		size = 0
	}
	if page <= 0 && size <= 0 {
		return -1, -1
	}
	if size >= 2000 {
		limit = 2000
	} else {
		limit = size
	}
	offset = (page - 1) * limit
	return
}
